package com.topisv.tms.repository.work.prepkg;

import java.util.List;

import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;

import com.topisv.tms.entity.work.prepkg.PrepkgUpItem;

/**
 * 上架任务明细（预包装流程）_DAO
 * @author ch
 *
 */
public abstract interface PrepkgUpItemDao extends PagingAndSortingRepository<PrepkgUpItem, Long>, JpaSpecificationExecutor<PrepkgUpItem>
{

	@Query("select t from PrepkgUpItem t where t.planCode=?")
	List<PrepkgUpItem> loadByPlanCode(String planCode);

	@Query("select t from PrepkgUpItem t where t.taskCode=?1 and t.sku=?2")
	PrepkgUpItem loadByTaskCodeAndSku(String taskCode, String sku);

	@Query("select t from PrepkgUpItem t where t.taskCode=? and t.status<>'upped' ")
	List<PrepkgUpItem> loadUnuppedItem(String taskCode);

	@Query("select t from PrepkgUpItem t where t.taskCode=?")
	List<PrepkgUpItem> loadByTaskCode(String taskCode);

}